<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class User_Model extends CI_Model {
	
	function __construct() {
		parent::__construct();
	}
	
	function login ($api){
		list($key,$code) = explode('-',$api);
    	$this->db->order_by("date_created", "desc"); 
    	$query = $this->db->get_where('clients', array('api' => $key,'code'=>$code));
    	return $query->result()[0];
	}
	
	function test(){
		echo "hello";
	}
	
	function getAllUsers(){
		$query = $this->db->get('users');
		return $query->result();
	}
	
	function getUserAccessModules($api, $user_id){
		
	}
}